<template>
  <div class="son1">
    <h2>Son1子组件</h2>
    从vuex中获取值：<label>{{ $store.state.count }}</label>
    <br>
    <button @click="handleAdd(1)">值 + 1</button>
    <button @click="handleAdd(5)">值 + 5</button>
  </div>
</template>

<script>
export default {
  methods: {
    handleAdd (n) {
      this.$store.commit('addCount', n)
    }
  }
}
</script>

<style>

</style>
